use master;
go
--insertBookingTable
alter proc insertBookingTable
	@[id] int identity(1,1) primary key,	
	@[customerid] int,	
	@[bookingdate] datetime,
	@[bookingtime] datetime,
	@[totalmoney] float,
	@[email] nvarchar(100),
	@[phone] nvarchar(100),
	@[descr] nvarchar(500),
	@[status] bit default(0)
as
insert into [BookingTable] ([id],[customerid],[bookingdate],[bookingtime],[totalmoney],[email],[phone],[descr],[status])
values (@[customerid],@[bookingdate],@[bookingtime],@[totalmoney],@[email],@[phone],@[descr],@[status])
GO
--updateStatusBookingTable
CREATE PROC updateStatusBookingTable
	@[id] int,
	@[status] bit 
AS
UPDATE [BookingTable] SET	
	[status] =@[status]
WHERE [id]=@[id]
GO
--DeleteBookingTable
CREATE PROC deleteBookingTable
	@[id] int
AS
	DELETE FROM [BookingTable] WHERE [id]=@[id]
GO
--getAllBookingTable
Alter PROC getAllBookingTable
AS
SELECT     [BookingTable].*, [Custormer].[username]
FROM         [BookingTable] INNER JOIN
                      [Custormer] ON [BookingTable].[customerid] = [Custormer].[id]
GO